package org.university.dto.request;

import java.util.List;

/**
 * @Author ：3570023082@qq.com
 * @Date ：2025/9/11 23:36
 * @Description ：页面请求参数record
 */
public record PageRequestParams(List<String> allowedFields, int page, int size, String sort) {
    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private List<String> allowedFields;
        private int page;
        private int size;
        private String sort;

        public Builder allowedFields(List<String> allowedFields) {
            this.allowedFields = allowedFields;
            return this;
        }

        public Builder page(int page) {
            this.page = page;
            return this;
        }

        public Builder size(int size) {
            this.size = size;
            return this;
        }

        public Builder sort(String sort) {
            this.sort = sort;
            return this;
        }

        public PageRequestParams build() {
            return new PageRequestParams(allowedFields, page, size, sort);
        }
    }
}